
import axios from 'axios';

/**
 * 供应原材料
 */
export class SupplyMaterialService {
    // 分页查询列表
    static findSupplyMaterials (queryParams) {
        return axios({
            url: '/restaurant/material/SupplyMaterial/findSupplyMaterials',
            method: 'POST',
            data: queryParams
        });
    }

    //根据ID查询指定的供应原材料
    static findSupplyMaterial (supplyMaterialId) {
        const query = {
            supplyMaterialId
        }
        return axios({
            url: '/restaurant/material/SupplyMaterial/findSupplyMaterial',
            method: 'POST',
            params: query,
        });
    }

    //根据ID查询指定的供应原材料(包含外键名称)
    static findSupplyMaterialForView (supplyMaterialId) {
        const query = {
            supplyMaterialId
        }
        return axios({
            url: '/restaurant/material/SupplyMaterial/findSupplyMaterialForView',
            method: 'POST',
            params: query,
        });
    }

    //根据ID查询指定的供应原材料(包含外键名称)
    static findSupplyMaterialForEdit (supplyMaterialId) {
        const query = {
            supplyMaterialId
        }
        return axios({
            url: '/restaurant/material/SupplyMaterial/findSupplyMaterialForEdit',
            method: 'POST',
            params: query,
        });
    }

    //根据ID查询指定的供应原材料(只提取ID 和 Name)
    static findSupplyMaterialsWithIdNameById (supplyMaterialId) {
        const query = {
            supplyMaterialId
        }
        return axios({
            url: '/restaurant/material/SupplyMaterial/findSupplyMaterialsWithIdNameById',
            method: 'POST',
            params: query,
        });
    }

    //根据名称查询供应原材料集合(只提取ID 和 Name)
    static findSupplyMaterialsWithIdNameByName (supplyMaterialName) {
        const query = {
            supplyMaterialName
        }
        return axios({
            url: '/restaurant/material/SupplyMaterial/findSupplyMaterialsWithIdNameByName',
            method: 'POST',
            params: query,
        });
    }

    //新增保存供应原材料
    static saveSupplyMaterial (supplyMaterial) {
        const query = {}
        return axios({
            url: '/restaurant/material/SupplyMaterial/saveSupplyMaterial',
            method: 'POST',
            params: query,
            data: supplyMaterial
        });
    }

    //修改保存供应原材料
    static updateSupplyMaterial (supplyMaterial) {
        const query = {}
        return axios({
            url: '/restaurant/material/SupplyMaterial/updateSupplyMaterial',
            method: 'POST',
            params: query,
            data: supplyMaterial
        });
    }

    //根据ID查询指定的供应原材料(只提取ID 和 Name)
    static deleteSupplyMaterial (supplyMaterialId) {
        const query = {
            supplyMaterialId
        }
        return axios({
            url: '/restaurant/material/SupplyMaterial/deleteSupplyMaterial',
            method: 'POST',
            params: query,
        });
    }
}
